package io.renren.modules.app.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.exception.RRException;
import io.renren.common.validator.Assert;
import io.renren.modules.app.dao.DomainDao;
import io.renren.modules.app.dao.UserDao;
import io.renren.modules.app.entity.DomainEntity;
import io.renren.modules.app.entity.UserEntity;
import io.renren.modules.app.form.LoginForm;
import io.renren.modules.app.service.DomainService;
import io.renren.modules.app.service.UserService;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("domainService")
public class DomainServiceImpl extends ServiceImpl<DomainDao, DomainEntity> implements DomainService {

	@Override
	public DomainEntity queryByDomain(String domain) {
		return baseMapper.selectOne(new QueryWrapper<DomainEntity>().eq("domain", domain));
	}

	@Override
	public List<DomainEntity> queryDomainListByParentId(long domainParentId) {
		QueryWrapper wrapper = new QueryWrapper();
		wrapper.eq("parent_id", domainParentId);
		wrapper.eq("status", 1);
		return baseMapper.selectList(wrapper);
	}


}
